<refresh> element
The <refresh> element is a task
element that instructs the device to refresh the specified card variables.
The device also refreshes the display if any of those variables are currently
shown.
Syntax
<refresh>content</refresh>
where content represents the
variables to refresh:
content |
You must specify at least one variable
in a <refresh> statement: |
|
|
<var> |
(see <setvar>
element) |
Example
The following WML builds on the example shown by adding
a "Clear" option that lets the user clear the First Name and Last Name
fields in order to enter new search criteria. The code specifies a second
<do> element that uses <refresh> to reset the first
and last variables to NULL when the user presses the
OPTIONS key.
<wml>
<card title="Employee" ordered="true">
<do type="ACCEPT" label="Find">
<go method="post"
url="?next=list">
<postfield name="NEXT"
value="list&"/>
<postfield name="L"
value="$last&"/>
<postfield name="F"
value="$first&"/>
</go>
</do>
<do type="OPTIONS" label="Clear">
<refresh>
<setvar name="first" value=""/>
<setvar name="last" value=""/>
</refresh>
</do>
Partial First Name:
<input title="First Name" name="first"/>
Partial Last Name:
<input title="Last Name" key="last"/>
</card>
</wml>
NOTE
You can use the <refresh> element to set
variables to any values, not just to "reset" them to NULL as shown
in this example.